home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / initramfs-tools / scripts / casper-functions < prev    next >
Text File  |  2008-11-11  |  1KB  |  42 lines

  1.  
  2. . /scripts/functions
  3.  
  4. # Print a message and wait for enter
  5. log_wait_msg()
  6. {
  7.     if [ -x /sbin/usplash_write ]; then
  8.         /sbin/usplash_write "INPUTENTER $@"
  9.         read nunya < /dev/.initramfs/usplash_outfifo
  10.     fi
  11.     _log_msg "Waiting: $@ ..."
  12. }
  13.  
  14. lang2locale() {
  15.     langpart="${1%%_*}"
  16.     if [ "$1" != "C" ]; then
  17.         # Match the language code with 1st field in languagelist
  18.         line=$(grep -v "^#" /root/usr/share/localechooser/languagelist | cut -f1,3,5 -d\; | grep -v ';C$' | grep "^$langpart[_;]")
  19.         if [ -n "$line" ]; then
  20.             if [ "$(echo "$line" | grep -c '')" -gt 1 ]; then
  21.                 # More than one match; try matching the
  22.                 # country as well.
  23.                 countrypart="${1#*_}"
  24.                 if [ "$countrypart" = "$1" ]; then
  25.                     countryline="$(echo "$line" | head -n1)"
  26.                     echo "${countryline##*;}"
  27.                     return
  28.                 fi
  29.                 countrypart="${countrypart%%[@.]*}"
  30.                 countryline="$(echo "$line" | grep ";$countrypart;" | head -n1 || true)"
  31.                 if [ "$countryline" ]; then
  32.                     echo "${countryline##*;}"
  33.                     return
  34.                 fi
  35.             fi
  36.             echo "${line##*;}"
  37.         fi
  38.     else
  39.         echo "C"
  40.     fi
  41. }
  42.